<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MCP架构逻辑图</title>
    <style>
        @media print {
            @page {
                size: 210mm 297mm; /* A4尺寸 */
                margin: 0;
            }
            body {
                width: 100vw;
                height: 100vh;
                margin: 0;
                padding: 10mm;
                box-sizing: border-box;
            }
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: #f5f5f7;
            color: #1d1d1f;
            padding: 20px;
            max-width: 800px;
            margin: 0 auto;
        }
        
        .container {
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.1);
            padding: 24px;
            margin: 20px 0;
        }
        
        h1 {
            color: #0066cc;
            font-weight: 600;
            text-align: center;
            margin-bottom: 32px;
        }
        
        .architecture {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        
        .layer {
            display: flex;
            justify-content: center;
            position: relative;
        }
        
        .component {
            background: linear-gradient(135deg, #f5f5f7 0%, #e5e5ea 100%);
            border: 1px solid #d2d2d7;
            border-radius: 8px;
            padding: 16px;
            text-align: center;
            min-width: 160px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            position: relative;
        }
        
        .client-server {
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            border-color: #90caf9;
        }
        
        .server {
            background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
            border-color: #a5d6a7;
        }
        
        .resources {
            background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
            border-color: #ffe082;
        }
        
        .arrow {
            position: absolute;
            width: 2px;
            height: 20px;
            background: #86868b;
            bottom: -20px;
            left: 50%;
        }
        
        .arrow:after {
            content: "";
            position: absolute;
            width: 8px;
            height: 8px;
            border-right: 2px solid #86868b;
            border-bottom: 2px solid #86868b;
            transform: rotate(45deg);
            bottom: 0;
            left: -3px;
        }
        
        .sub-components {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 40px;
        }
        
        .sub-component {
            background: linear-gradient(135deg, #f5f5f7 0%, #e5e5ea 100%);
            border: 1px solid #d2d2d7;
            border-radius: 8px;
            padding: 12px;
            width: 120px;
            font-size: 14px;
        }
        
        .server-components {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 20px;
        }
        
        .server-component {
            background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
            border: 1px solid #80deea;
            border-radius: 8px;
            padding: 12px;
            width: 100px;
            font-size: 13px;
        }
        
        .resource-layer {
            display: flex;
            justify-content: center;
            gap: 40px;
            margin-top: 40px;
        }
        
        .resource {
            background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
            border: 1px solid #ce93d8;
            border-radius: 8px;
            padding: 12px;
            width: 140px;
        }
        
        .emoji {
            font-size: 24px;
            margin-bottom: 8px;
            display: block;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>MCP 架构逻辑图</h1>
        
        <div class="architecture">
            <!-- Layer 1: MCP Host -->
            <div class="layer">
                <div class="component">
                    <span class="emoji">💻</span>
                    <strong>MCP Host</strong>
                    <p>运行AI模型的应用程序</p>
                    <div class="arrow"></div>
                </div>
            </div>
            
            <!-- Layer 2: MCP Client -->
            <div class="layer">
                <div class="component client-server">
                    <span class="emoji">📱</span>
                    <strong>MCP Client</strong>
                    <p>消息路由 & 协议协商</p>
                    <div class="arrow"></div>
                </div>
            </div>
            
            <!-- Layer 3: MCP Server -->
            <div class="layer">
                <div class="component server">
                    <span class="emoji">🌐</span>
                    <strong>MCP Server</strong>
                    <p>三类核心能力</p>
                    <div class="arrow"></div>
                </div>
            </div>
            
            <!-- Server Components -->
            <div class="server-components">
                <div class="server-component">
                    <span class="emoji">🗃️</span>
                    <strong>Resources</strong>
                    <p>静态数据接口</p>
                </div>
                <div class="server-component">
                    <span class="emoji">🛠️</span>
                    <strong>Tools</strong>
                    <p>可执行函数</p>
                </div>
                <div class="server-component">
                    <span class="emoji">📝</span>
                    <strong>Prompts</strong>
                    <p>预定义任务模板</p>
                </div>
            </div>
            
            <!-- Layer 4: Resource Layer -->
            <div class="layer">
                <div class="component resources">
                    <span class="emoji">🗂️</span>
                    <strong>资源层</strong>
                    <div class="arrow"></div>
                </div>
            </div>
            
            <!-- Resource Types -->
            <div class="resource-layer">
                <div class="resource">
                    <span class="emoji">📁</span>
                    <strong>本地资源</strong>
                    <p>文件系统</p>
                </div>
                <div class="resource">
                    <span class="emoji">☁️</span>
                    <strong>远程资源</strong>
                    <p>Slack API等</p>
                </div>
            </div>
        </div>
    </div>
</body>
</html>